"""
求列表中数字和,列表中嵌套层次不限2层
"""
def judge(l):
    result = 0
    if type(l) == str:
        return 0
    elif type(l) == list:
        for i in l:
            result += judge(i)
    elif type(l) == tuple:
        for i in l:
            result += judge(i)
    elif type(l) == int:
        result += l
    return result
list1 = list(eval(input()))
sum1 = 0
for i in list1:
    sum1 += judge(i)
print(sum1)